package org.backend.canteenbackend.persistence;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.backend.canteenbackend.entity.Item;
import org.backend.canteenbackend.vo.ItemVO;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
@Mapper
public interface ItemMapper extends BaseMapper<Item> {
    @Select("SELECT list_price FROM item WHERE item_id = #{itemId}")
    BigDecimal getListPriceByItemId(String itemId);

    @Select("SELECT * FROM item")
    List<ItemVO> getAllItems();
}
